# Maintainer:
pkgname=py3-kgb
pkgver=7.1.1
pkgrel=3
pkgdesc="Python function spy support for unit tests "
url="https://github.com/beanbaginc/kgb"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.io/packages/source/k/kgb/kgb-$pkgver.tar.gz"
builddir="$srcdir/kgb-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/kgb/tests
}

sha512sums="
29e5d78270f55b82b917a1e448307397f813502cc3a262fd6af082417f3875c88732b3f7c11c6001120bb0cba4079c2c6351b2b24287b1f5a3b3c891cf3f8d55  kgb-7.1.1.tar.gz
"
